<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <!-- <img class="banner-img" src="https://imgs.qunarzz.com/vs_ceph_vs_tts/ba97b742-c01d-4af6-9682-e82b2a8bfea6.jpg_r_390x260x95_1726cf19.jpg" alt=""> -->
      <img class="banner-img" :src="bannerImg" alt="">
      <div class="banner-info">
        <!-- <div class="banner-title">可单订机票🔥泰国苏梅岛6/7自由行/海边泳池酒店/接送管家服务;直飞上岛</div> -->
        d<div class="banner-title">{{this.sightName}}</div>
        <div class="banner-number"><span class="iconfont banner-icon">&#xe674;</span>{{this.bannerImgs.length}}</div>
      </div>
    </div>
    <fade-animation >
      <common-gallary
      :imgs="bannerImgs"
      v-show="showGallary"
      @close="handleGallaryClose"></common-gallary>
    </fade-animation>
  </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/FadeAnimation'
export default {
  name: 'DetailBanner',
  props: {
    sightName: String,
    bannerImg: String,
    bannerImgs: Array
  },
  data () {
    return {
      showGallary: false,
      imgs: ['https://imgs.qunarzz.com/p/tts4/1712/b1/8b572f82417b4b02.jpg_r_390x260x95_75d90366.jpg', 'https://imgs.qunarzz.com/vs_ceph_vs_tts/bfab7794-2130-49dc-96cb-b5371c2510fd.jpg_r_390x260x95_6d800627.jpg']
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  },
  components: {
    CommonGallary,
    FadeAnimation
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/variable.styl'
  @import '~styles/mixins.styl'
  .banner
    overflow: hidden
    height: 0
    position: relative
    padding-bottom: 55%
    .banner-img
      width: 100%
    .banner-info
      display: flex
      position: absolute
      left: 0
      right: 0
      bottom: 0
      line-height: 2.6rem
      color: #fff
      padding-right: 1rem
      padding-left: .5rem
      background-image: linear-gradient(top, rgba(0,0,0, 0), rgba(0, 0, 0, 0.8))
      .banner-title
        flex: 1
        font-size: 14px
        // padding: 0 1rem
        ellipsis()
      .banner-number
        padding: 0 1rem
        height: 1.2rem
        line-height: 1.2rem
        border-radius: .5rem
        background: rgba(0, 0, 0, .8)
        margin: auto 0
</style>
